var express = require('express');
var router = express.Router();
var sign =require('./sign.js');
var bodyParser = require('body-parser');

exports.userList = function(req,res){
	sign.delEmptyValue(req.body); 
    sign.dataReq(req,req.body,req.session.apikey,'/sysmanage/user/list',"POST",function(ResData){
        if(ResData!=""){
            res.json(ResData);
        }
    });
}

exports.userGet = function(req,res){
    var  data={"id":req.body.id};
	sign.dataReq(req,data,req.session.apikey,'/sysmanage/user/getUser',"POST",function(ResData){
        if(ResData!=""){
            res.json(ResData);
        }
    });
}

exports.userEdit = function(req,res){
        sign.dataReq(req,req.body,req.session.apikey,'/sysmanage/user/edit',"POST",function(ResData){
            if(ResData!=""){
             	res.json(ResData);
        }
    });
}

exports.getRoleList=function(req,res){
    sign.dataReq(req,req.body,req.session.apikey,'/sysmanage/user/getRoleList',"POST",function(ResData){
        if(ResData!=""){
            res.json(ResData);
         
        }
    });
}

exports.userDel = function(req,res){
	sign.dataReq(req,{'ids':[req.body.id]},req.session.apikey,'/sysmanage/user/del',"POST",function(ResData){
        if(ResData!=""){
            res.json(ResData);
        	
        }
    });
}



